<template>
  <div class="news-content">
    <div v-for="(item, index) in content" :key="index">
      <p v-if="item.text" class="news-text">{{item.text}}</p>
      <div v-if="item.img" class="news-img">
        <div>
          <p v-for="(headerItem, itemIndex) in item.header" :key="`img_header_${itemIndex}`" class="news-img-header">{{headerItem}}</p>
        </div>
        <img :src="item.img" />
        <div>
          <p v-for="(footerItem, footerIndex) in item.footer" :key="`img_footer_${footerIndex}`" class="news-img-footer">{{footerItem}}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    content: {
      type: Array,
      required: true
    }
  }
}
</script>
<style lang="stylus" scoped>
.news-content{
  width: 1000px;
  margin: 0 auto;
  padding: 40px 0;
  .news-text{
    margin-bottom: 30px;
    line-height: 24px;
    color: #404040;
    font-size: 16px;
    font-weight: 400;
  }
  .news-img{
    margin-bottom: 30px;
    img{
      width: 100%;
    }
    .news-img-header{
      line-height: 36px;
      color: #4676FE;
      font-size: 20px;
      font-weight: bold;
      text-align: center;
      &:last-child{
        margin-bottom: 10px;
      }
    }
    .news-img-footer{
      line-height: 36px;
      color: #404040;
      font-size: 16px;
      font-weight: bold;
      text-align: center;
      &:first-child{
        margin-top: 10px;
      }
    }
  }
}
</style>